<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
	  xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
	  layout:decorate="layout/admin_main">
<!--<![endif]-->
<!-- BEGIN HEAD -->
<head>
<title>运营中心 | 模块编辑</title>
</head>

<body th:with="cur='sel-sys',cur_sub='sel-role'">

<th:block layout:fragment="content">
<div class="page-content-wrapper">
	<div class="portlet page-content">

		<div class="row">
			<div class="col-md-12">
				<ul class="page-breadcrumb breadcrumb">
					<li><i class="fa fa-home"></i> <a href="/admin/index.shtml">首页</a> <i class="fa fa-angle-right"></i></li>
					<li>角色编辑</li>
				</ul>
				<!-- END PAGE TITLE & BREADCRUMB-->
			</div>
		</div>

		<div class="portlet-body form">
			<!-- BEGIN FORM-->
			<form action="updateSystemRole.shtml" class="form-horizontal" method="post" id="submitForm">
				<input type="hidden" name="id" th:value="${role?.id}"/>
				<div class="form-body">
					<div class="form-group first">
						<label class="col-md-3 control-label"><span style="color:red">*</span>名称</label>
						<div class="col-md-4">
						   <input name="name" class="form-control" placeholder="名称" maxlength="50" th:value="${role?.name}"/>
						</div>
					</div>

					<div class="form-group first">
						<label class="col-md-3 control-label">应用ID</label>
						<div class="col-md-4">
							<input name="appId" class="form-control" placeholder="应用ID" maxlength="50" th:value="${role?.appId}"/>
						</div>
					</div>

					<div class="form-group">
						<label class="col-md-3 control-label">权限集</label>
						<div class="col-md-7">
						        &nbsp;&nbsp;
						   <label class="checkbox-inline" th:each="module, vs:${modules}">
							<div class="checker"><span><input th:name="'modules['+${vs.index}+'].id'" type="checkbox" th:value="${module.id}" th:checked="${module.checked == true}"></span></div><span th:text="${module.title}"></span></label>
						</div>
					</div>

					<div class="form-group">
						<label class="col-md-3 control-label">状态</label>
						<div class="col-md-4">
							<div class="radio-list">
								<label class="radio-inline">
									<div class="radio"><span><input type="radio" name="status" value="ENABLE" th:checked="${role == null || role.status == null || role.status == 'ENABLE'}"></span>启用</div>
								</label>
								<label class="radio-inline">
									<div class="radio"><span><input type="radio" name="status" value="DISABLE" th:checked="${role != null && role.status == 'DISABLE'}"></span>禁用</div>
								</label>
							</div>
						</div>
					</div>
				</div>
				<div class="form-actions fluid">
					<div class="col-md-offset-3 col-md-9">
						<button type="submit" class="btn blue">提交</button>
						<button type="button" class="btn default goback">取消</button>
					</div>
				</div>
			</form>
			<!-- END FORM-->
		</div>
	</div>
</div>

<script src="/admin/js/role.js?v=${version}" type="text/javascript"></script>
<script src="/common/js/goback.js?v=${version}" type="text/javascript"></script>
<script>
	$(function() {
		Role.init();
	});
</script>
	<div th:replace="/common/bootbox"></div>
</th:block>
</body>
</html>